/*
 * This file is part of Plop Messenger.
 *
 * Plop Messenger is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  Plop Messenger is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Plop Messenger.  If not, see <http://www.gnu.org/licenses/>.
 */
package pm;

import java.net.SocketException;

import javax.swing.UIManager;

import pm.net.PosteMsg;
import pm.ui.MainFrame;
import pm.ui.MainFrameChanFactory;
import pm.util.Msg;
import pm.util.Options;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
		}
		Msg.addBundle(Constantes.DEFAULT_BUNDLE);
		Options options = Options.loadFrom(Constantes.OPTIONS_FILE);
		MainFrame mainFrame = new MainFrame(options);
		try {
			ChanFactory chanFactory = new MainFrameChanFactory(mainFrame);
			ChanManager manager = new ChanManager(chanFactory, new PosteMsg(
					Constantes.UDP_PORT), options);
		} catch (SocketException e) {
			e.printStackTrace();
		}
		mainFrame.setVisible(true);
	}

}
